#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
__title__ = ''
__author__ = 'hello'
__mtime__ = '2019-01-16'
# code is far away from bugs with the god animal protecting
    I love animals. They taste delicious.
              ┏┓      ┏┓
            ┏┛┻━━━┛┻┓
            ┃      ☃      ┃
            ┃  ┳┛  ┗┳  ┃
            ┃      ┻      ┃
            ┗━┓      ┏━┛
                ┃      ┗━━━┓
                ┃  神兽保佑    ┣┓
                ┃　永无BUG！   ┏┛
                ┗┓┓┏━┳┓┏┛
                  ┃┫┫  ┃┫┫
                  ┗┻┛  ┗┻┛
"""

import os
# from flask import Flask
#
# app = Flask(__name__)
#
# @app.route('/')
# def index():
#     return 'success '
#
# if __name__ == '__main__':
#     app.run()

curr_dir = os.path.dirname(os.path.abspath(__file__))
filtered_words_txt_path = os.path.join(curr_dir,'sensitive_words.txt')
import chardet

def filter_replace(string):
    string = string
    filtered_words = []
    with open(filtered_words_txt_path) as filtered_words_txt:
        lines = filtered_words_txt.readlines()
        for line in lines:
            filtered_words.append(line.strip())
    print replace(filtered_words, string)

def replace(filtered_words,string):
    new_string = string
    for words in filtered_words:
        if words in string:
            # new_string = string.replace(words,"*"*len(words))
            new_string = string.replace(words,"\033[0;31m%s\033[0m" % words)
            print("\033[0;31m%s\033[0m" % "输出红色字符")
    if new_string == string:
        return new_string
    else:
        return replace(filtered_words,new_string)

if __name__ == '__main__':
    filter_replace(raw_input("Type:"))